package com.lantosec.hmrp.modules.morality.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.morality.vo.MoralityCycleVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 考评周期定义 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-04-16
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MoralityCycle extends BaseEntity<MoralityCycleVO> {

    private static final long serialVersionUID = 1L;
    public MoralityCycle(MoralityCycleVO vo){
        this.moralityCycleId = vo.getMoralityCycleId();
        this.moralityCycleName = vo.getMoralityCycleName();
        this.cycleStartDate = vo.getCycleStartDate();
        this.cycleEndDate = vo.getCycleEndDate();
        this.rewardStartDate = vo.getRewardStartDate();
        this.rewardEndDate = vo.getRewardEndDate();
        this.selfStartDate = vo.getSelfStartDate();
        this.selfEndDate = vo.getSelfEndDate();
        this.deptStartDate = vo.getDeptStartDate();
        this.deptEndDate = vo.getDeptEndDate();
        this.branchStartDate = vo.getBranchStartDate();
        this.branchEndDate = vo.getBranchEndDate();
        this.committeeStartDate = vo.getCommitteeStartDate();
        this.committeeEndDate = vo.getCommitteeEndDate();
    }

    @Override
    public MoralityCycleVO convertToVO(){
        return new MoralityCycleVO(this);
    }


    /**
     * 考评周期ID
     */
    @TableId(value = "morality_cycle_id", type = IdType.AUTO)
    private Integer moralityCycleId;

    /**
     * 周期名称
     */
    private String moralityCycleName;

    /**
     * 考评开始时间（格式：yyyy-MM-dd）
     */
    private String cycleStartDate;

    /**
     * 考评结束时间（格式：yyyy-MM-dd）
     */
    private String cycleEndDate;

    /**
     * 调取加减分项目开始时间
     */
    private String rewardStartDate;

    /**
     * 调取加减分项目结束时间
     */
    private String rewardEndDate;

    /**
     * 自评开始时间
     */
    private String selfStartDate;

    /**
     * 自评结束时间
     */
    private String selfEndDate;

    /**
     * 科室考评开始时间
     */
    private String deptStartDate;

    /**
     * 科室考评结束时间
     */
    private String deptEndDate;

    /**
     * 党支部考评开始时间
     */
    private String branchStartDate;

    /**
     * 党支部考评结束时间
     */
    private String branchEndDate;

    /**
     * 考评委员会考评开始时间
     */
    private String committeeStartDate;

    /**
     * 考评委员会考评结束时间
     */
    private String committeeEndDate;


    public enum ColName {
        morality_cycle_id, morality_cycle_name, cycle_start_date, cycle_end_date, reward_start_date, reward_end_date, self_start_date, self_end_date, dept_start_date, dept_end_date, branch_start_date, branch_end_date, committee_start_date, committee_end_date, 
    }
}
